package o;

import android.content.Context;
import android.content.res.Configuration;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window.Callback;
import androidx.appcompat.app.ActionBar;
import androidx.core.view.ViewCompat;
import java.util.ArrayList;
import o.bn.d;

public class am extends ActionBar {
    private final Runnable ʻ;
    private boolean ˊ;
    ck ˋ;
    private ArrayList<androidx.appcompat.app.ActionBar.c> ˎ;
    Callback ˏ;
    private boolean ॱ;

    final class c implements d {
        final /* synthetic */ am ˋ;
        private boolean ˎ;

        c(am amVar) {
            this.ˋ = amVar;
        }

        public boolean ˎ(bd bdVar) {
            if (this.ˋ.ˏ == null) {
                return false;
            }
            this.ˋ.ˏ.onMenuOpened(108, bdVar);
            return true;
        }

        public void ॱ(bd bdVar, boolean z) {
            if (!this.ˎ) {
                this.ˎ = true;
                this.ˋ.ˋ.ˏॱ();
                if (this.ˋ.ˏ != null) {
                    this.ˋ.ˏ.onPanelClosed(108, bdVar);
                }
                this.ˎ = false;
            }
        }
    }

    final class e implements o.bd.e {
        final /* synthetic */ am ˏ;

        e(am amVar) {
            this.ˏ = amVar;
        }

        public boolean ॱ(bd bdVar, MenuItem menuItem) {
            return false;
        }

        public void ˎ(bd bdVar) {
            if (this.ˏ.ˏ == null) {
                return;
            }
            if (this.ˏ.ˋ.ॱॱ()) {
                this.ˏ.ˏ.onPanelClosed(108, bdVar);
            } else if (this.ˏ.ˏ.onPreparePanel(0, null, bdVar)) {
                this.ˏ.ˏ.onMenuOpened(108, bdVar);
            }
        }
    }

    public void ˊ(boolean z) {
    }

    public void ॱ(float f) {
        ViewCompat.ˋ(this.ˋ.ˏ(), f);
    }

    public Context ॱ() {
        return this.ˋ.ˎ();
    }

    public void ॱ(boolean z) {
    }

    public void ˎ(boolean z) {
    }

    public void ˎ(Configuration configuration) {
        super.ˎ(configuration);
    }

    public void ˏ(CharSequence charSequence) {
        this.ˋ.ˋ(charSequence);
    }

    public int ˎ() {
        return this.ˋ.ˋॱ();
    }

    public boolean ˊ() {
        return this.ˋ.ʻ();
    }

    public boolean ˋ() {
        return this.ˋ.ˊॱ();
    }

    public boolean ˏ() {
        this.ˋ.ˏ().removeCallbacks(this.ʻ);
        ViewCompat.ˏ(this.ˋ.ˏ(), this.ʻ);
        return true;
    }

    public boolean ᐝ() {
        if (!this.ˋ.ॱ()) {
            return false;
        }
        this.ˋ.ˊ();
        return true;
    }

    public boolean ˋ(KeyEvent keyEvent) {
        if (keyEvent.getAction() == 1) {
            ˊ();
        }
        return true;
    }

    public boolean ˊ(int i, KeyEvent keyEvent) {
        Menu ॱॱ = ॱॱ();
        if (ॱॱ == null) {
            return false;
        }
        boolean z;
        if (KeyCharacterMap.load(keyEvent != null ? keyEvent.getDeviceId() : -1).getKeyboardType() != 1) {
            z = true;
        } else {
            z = false;
        }
        ॱॱ.setQwertyMode(z);
        return ॱॱ.performShortcut(i, keyEvent, 0);
    }

    public void ʽ() {
        this.ˋ.ˏ().removeCallbacks(this.ʻ);
    }

    public void ˋ(boolean z) {
        if (z != this.ˊ) {
            this.ˊ = z;
            int size = this.ˎ.size();
            for (int i = 0; i < size; i++) {
                ((androidx.appcompat.app.ActionBar.c) this.ˎ.get(i)).ˎ(z);
            }
        }
    }

    private Menu ॱॱ() {
        if (!this.ॱ) {
            this.ˋ.ˎ(new c(this), new e(this));
            this.ॱ = true;
        }
        return this.ˋ.ॱˎ();
    }
}
